package com.group.library.order.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.group.library.order.dao.NoticeMapper;
import com.group.library.order.entity.Notice;
import com.group.library.order.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {

    @Autowired
    private NoticeMapper noticeMapper;

    @Override
    public PageInfo<Notice> findNotice(Integer page, Integer limit, Integer status) {
        PageHelper.startPage(page,limit);
        List<Notice> notices = noticeMapper.findNotice(status);
        return new PageInfo<Notice>(notices);
    }
}
